import { http } from "@/utils/http"


// 标签推荐
export const getTagsGetTagsListAPI = () => {
  return http({
      method: 'GET',
      url: '/api/tags/getTagsList'
  })
}

// 推荐旅游
export const getTouristRecommendAPI = () => {
  return http({
      method: 'GET',
      url: '/api/tourist/recommend'
  })
}

// 根据id查询旅游信息
export const getTouristAPI = (id: string) => {
  return http({
      method: 'GET',
      url: '/api/tourist',
      data: { id }
  })
}

// 图片/文件上传
export const getCommonUploaAPI = (file: string) => {
  return http({
      method: 'POST',
      url: '/api/common/upload',
      data: { file }
  })
}


// 评论获取
export const getCommentCommentAPI = (touristId: string) => {
  return http({
      method: 'GET',
      url: '/api/comment/getComment',
      data: { touristId }
  })
}

// 查询用户ID仅自己可见
export const getTouristIDAPI = (userId: string) => {
  return http({
      method: 'GET',
      url: `/api/tourist/byUserId/${userId}`,
  })
}


// 添加旅游信息
export const gettouristAddAPI = (data: tourist[]) => {
  return http({
      method: 'POST',
      url: '/api/tourist/add',
      data
  })
}

// 用户登录
export const getLoginAPI = (data: any) => {
  return http({
      method: 'POST',
      url: '/api/user/login',
      data
  })
}


// 根据id查询标签推荐
export const getTagRecommendAPI = (tag: string) => {
  return http({
      method: 'GET',
      url: `/api/tourist/tagRecommend/${tag}`,
  })
}
